package com.xujl.hsns.test;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.serializer.*;
import com.norteksoft.erm.model.*;
public class FastJson {
	
	
	static String json="{\"@type\":\"com.norteksoft.erm.model.User\",\"displayOrder\":0,\"groups\":[{\"@type\":\"com.norteksoft.erm.model.Group\",\"allowDomainRole\":\"false\",\"asManageDomain\":\"true\",\"childGroups\":[],\"code\":\"ffff\",\"fullName\":\"ffff\",\"fullPath\":\"30176\",\"groupID\":30176,\"groupName\":\"ffff\",\"hasChild\":\"false\",\"localRoles\":[],\"manageDomain\":true,\"memo\":\"ffff\",\"nodeID\":\"30176\",\"nodeName\":\"ffff\",\"parentID\":\"\",\"rights\":[],\"seniorGroupOIDs\":Set[\"30176\"],\"upGroups\":[\"30176\"],\"users\":[{\"$ref\":\"$\"}],\"version\":2},{\"@type\":\"com.norteksoft.erm.model.Group\",\"asManageDomain\":\"true\",\"childGroups\":[],\"code\":\"admins\",\"fullPath\":\"1\",\"groupID\":1,\"groupName\":\"系统管理\",\"localRoles\":[],\"manageDomain\":true,\"memo\":\"系统管理员组\",\"nodeID\":\"1\",\"nodeName\":\"系统管理\",\"parentID\":\"\",\"rights\":[],\"seniorGroupOIDs\":Set[\"1\"],\"users\":[{\"$ref\":\"$\"},{\"@type\":\"com.norteksoft.erm.model.User\",\"displayOrder\":0,\"email\":\"admin@nor.com\",\"first\":\"Y\",\"groups\":[{\"$ref\":\"$.groups[1]\"}],\"jobLevel\":{\"@type\":\"com.norteksoft.erm.model.JobLevel\",\"myLevel\":0,\"name\":\"公司职员\",\"oID\":1,\"users\":[{\"$ref\":\"$.groups[1].users[1]\"},{\"@type\":\"com.norteksoft.erm.model.User\",\"displayOrder\":0,\"groups\":[],\"jobLevel\":{\"$ref\":\"$.groups[1].users[1].jobLevel\"},\"lastLoginDate\":new Date(1324438013723),\"loginFailureCount\":0,\"myFiles\":[],\"myPartTimeGroups\":Set[],\"password\":\"c4ca4238a0b923820dcc509a6f75849b\",\"realName\":\"无权限用户\",\"rights\":[],\"roles\":[],\"state\":\"normal\",\"userID\":30374,\"userName\":\"lichaotest\",\"username\":\"lichaotest\",\"version\":13,\"webModules\":[]},{\"$ref\":\"$\"},{\"@type\":\"com.norteksoft.erm.model.User\",\"displayOrder\":0,\"groups\":[],\"jobLevel\":{\"$ref\":\"$.groups[1].users[1].jobLevel\"},\"lastLoginDate\":new Date(1324439077963),\"loginFailureCount\":0,\"myFiles\":[],\"myPartTimeGroups\":Set[],\"password\":\"c4ca4238a0b923820dcc509a6f75849b\",\"realName\":\"1\",\"rights\":[],\"roles\":[],\"state\":\"normal\",\"userID\":30414,\"userName\":\"lichaonorepair\",\"username\":\"lichaonorepair\",\"version\":3,\"webModules\":[]},{\"@type\":\"com.norteksoft.erm.model.User\",\"displayOrder\":0,\"groups\":[],\"jobLevel\":{\"$ref\":\"$.groups[1].users[1].jobLevel\"},\"lastLoginDate\":new Date(1324438601102),\"loginFailureCount\":0,\"myFiles\":[],\"myPartTimeGroups\":Set[],\"password\":\"c4ca4238a0b923820dcc509a6f75849b\",\"realName\":\"李超\",\"rights\":[],\"roles\":[],\"state\":\"normal\",\"userID\":30330,\"userName\":\"lichao\",\"username\":\"lichao\",\"version\":24,\"webModules\":[]},{\"@type\":\"com.norteksoft.erm.model.User\",\"displayOrder\":0,\"groups\":[],\"jobLevel\":{\"$ref\":\"$.groups[1].users[1].jobLevel\"},\"lastLoginDate\":new Date(1324448918992),\"loginFailureCount\":0,\"myFiles\":[],\"myPartTimeGroups\":Set[],\"password\":\"c4ca4238a0b923820dcc509a6f75849b\",\"realName\":\"111\",\"rights\":[],\"roles\":[],\"state\":\"normal\",\"userID\":30434,\"userName\":\"lichao1\",\"username\":\"lichao1\",\"version\":10,\"webModules\":[]}],\"version\":6},\"lastChpasswdDate\":new Date(1324265839518),\"lastLoginDate\":new Date(1326180183756),\"loginFailureCount\":0,\"mainGroupID\":1,\"myFiles\":[],\"myMainGroup\":{\"$ref\":\"$.groups[1]\"},\"myPartTimeGroups\":Set[],\"password\":\"698d51a19d8a121ce581499d7b701668\",\"passwordHistory\":{\"password1\":\"c4ca4238a0b923820dcc509a6f75849b\",\"password2\":\"202cb962ac59075b964b07152d234b70\",\"password3\":\"698d51a19d8a121ce581499d7b701668\"},\"realName\":\"超级管理员\",\"rights\":[],\"roles\":[],\"state\":\"normal\",\"userID\":1,\"userName\":\"admin\",\"username\":\"admin\",\"version\":273,\"webModules\":[{\"@type\":\"com.norteksoft.erm.model.WebModule\",\"code\":\"ERM\",\"contextURL\":\"http://www.jiffy.com:8088/erm\",\"myDataResources\":[{\"@type\":\"com.norteksoft.erm.model.DataResource\",\"clazzName\":\"bbb\",\"dataDimensions\":[{\"@type\":\"com.norteksoft.erm.model.DataDimension\",\"attribute\":\"b\",\"attributeType\":\"string\",\"dataDomains\":[{\"@type\":\"com.norteksoft.erm.model.DataDomain\",\"dataDimension\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0].dataDimensions[0]\"},\"dataPermissions\":[],\"name\":\"bvbnv\",\"oID\":30165,\"operator\":\"eq\",\"remark\":\"mnbvmbv\",\"rule\":\"b = 'b'\",\"value1\":\"b\",\"version\":0}],\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0]\"},\"dbAttribute\":\"b\",\"name\":\"b\",\"oID\":30149,\"version\":1}],\"dataOperations\":[{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"CREATE\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0]\"},\"mask\":0,\"name\":\"创建\",\"oID\":30155,\"occasion\":\"before\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"SEARCH\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0]\"},\"mask\":1,\"name\":\"检索\",\"oID\":30154,\"occasion\":\"after\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"VIEW\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0]\"},\"mask\":2,\"name\":\"查看\",\"oID\":30153,\"occasion\":\"after\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"MODIFY\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0]\"},\"mask\":3,\"name\":\"修改\",\"oID\":30152,\"occasion\":\"after\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"DELETE\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0]\"},\"mask\":4,\"name\":\"删除\",\"oID\":30151,\"occasion\":\"after\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"LIST\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0]\"},\"mask\":5,\"name\":\"列表\",\"oID\":30150,\"occasion\":\"after\",\"version\":0}],\"dataResourceType\":\"rdb\",\"dataRoles\":[{\"@type\":\"com.norteksoft.erm.model.DataRole\",\"attribute\":\"b\",\"attributeType\":\"userName\",\"authzMode\":[\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],\"code\":\"b\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[0]\"},\"dbAttribute\":\"b\",\"name\":\"b\",\"oID\":30156,\"version\":0}],\"hasDataRole\":true,\"isAvailable\":\"true\",\"memo\":\"bbb\",\"name\":\"bbb\",\"oID\":30148,\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.DataResource\",\"clazzName\":\"m\",\"dataDimensions\":[{\"@type\":\"com.norteksoft.erm.model.DataDimension\",\"attribute\":\"m\",\"attributeType\":\"string\",\"dataDomains\":[],\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[1]\"},\"dbAttribute\":\"m\",\"name\":\"m\",\"oID\":30167,\"version\":0}],\"dataOperations\":[{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"CREATE\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[1]\"},\"mask\":0,\"name\":\"创建\",\"oID\":30173,\"occasion\":\"before\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"SEARCH\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[1]\"},\"mask\":1,\"name\":\"检索\",\"oID\":30172,\"occasion\":\"after\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"VIEW\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[1]\"},\"mask\":2,\"name\":\"查看\",\"oID\":30171,\"occasion\":\"after\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"MODIFY\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[1]\"},\"mask\":3,\"name\":\"修改\",\"oID\":30170,\"occasion\":\"after\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"DELETE\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[1]\"},\"mask\":4,\"name\":\"删除\",\"oID\":30169,\"occasion\":\"after\",\"version\":0},{\"@type\":\"com.norteksoft.erm.model.DataOperation\",\"code\":\"LIST\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[1]\"},\"mask\":5,\"name\":\"列表\",\"oID\":30168,\"occasion\":\"after\",\"version\":0}],\"dataResourceType\":\"rdb\",\"dataRoles\":[{\"@type\":\"com.norteksoft.erm.model.DataRole\",\"attribute\":\"mm\",\"attributeType\":\"userName\",\"authzMode\":[\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],\"code\":\"mm\",\"dataResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].myDataResources[1]\"},\"dbAttribute\":\"mm\",\"name\":\"mm\",\"oID\":30174,\"version\":0}],\"hasDataRole\":true,\"isAvailable\":\"true\",\"memo\":\"mmmmmmmmm\",\"name\":\"m\",\"oID\":30166,\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"resources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"childResources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/authz/index.erm\",\"childResources\":[],\"fullPath\":\"7-105\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"105\",\"nodeName\":\"function_erm_authz（授权管理_页签）\",\"parentID\":\"7\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_authz\",\"resourceName\":\"授权管理_页签\",\"rsID\":105,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"fullPath\":\"7\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"nodeID\":\"7\",\"nodeName\":\"MOD_ERM_AUTHZ（授权管理）\",\"parentID\":\"\",\"protectedFunc\":false,\"resourceID\":\"MOD_ERM_AUTHZ\",\"resourceName\":\"授权管理\",\"rsID\":7,\"type\":\"pkg\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"childResources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/bizlog/index.erm\",\"childResources\":[],\"fullPath\":\"8-106\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"106\",\"nodeName\":\"function_erm_bizlog（系统日志_页签）\",\"parentID\":\"8\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_bizlog\",\"resourceName\":\"系统日志_页签\",\"rsID\":106,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"fullPath\":\"8\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"nodeID\":\"8\",\"nodeName\":\"MOD_ERM_BIZLOG（系统日志）\",\"parentID\":\"\",\"protectedFunc\":false,\"resourceID\":\"MOD_ERM_BIZLOG\",\"resourceName\":\"系统日志\",\"rsID\":8,\"type\":\"pkg\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"childResources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/console/index.erm\",\"childResources\":[],\"fullPath\":\"2-100\",\"funcLogDefinition\":{\"isEnable\":\"false\"},\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"logable\":\"false\",\"nodeID\":\"100\",\"nodeName\":\"function_erm_console（系统控制台_页签）\",\"parentID\":\"2\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_console\",\"resourceName\":\"系统控制台_页签\",\"rsID\":100,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"fullPath\":\"2\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"nodeID\":\"2\",\"nodeName\":\"MOD_ERM_CONSOLE（系统控制台）\",\"parentID\":\"\",\"protectedFunc\":false,\"resourceID\":\"MOD_ERM_CONSOLE\",\"resourceName\":\"系统控制台\",\"rsID\":2,\"type\":\"pkg\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"childResources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/org/index.erm\",\"childResources\":[],\"fullPath\":\"3-101\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"101\",\"nodeName\":\"function_erm_org（部门管理_页签）\",\"parentID\":\"3\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_org\",\"resourceName\":\"部门管理_页签\",\"rsID\":101,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"fullPath\":\"3\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"nodeID\":\"3\",\"nodeName\":\"MOD_ERM_ORG（部门管理）\",\"parentID\":\"\",\"protectedFunc\":false,\"resourceID\":\"MOD_ERM_ORG\",\"resourceName\":\"部门管理\",\"rsID\":3,\"type\":\"pkg\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"childResources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/param/index.erm\",\"childResources\":[],\"fullPath\":\"9-107\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"107\",\"nodeName\":\"function_erm_param（参数配置_页签）\",\"parentID\":\"9\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_param\",\"resourceName\":\"参数配置_页签\",\"rsID\":107,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/systemmanager/approve_flow_main.jsp\",\"childResources\":[],\"fullPath\":\"9-108\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"108\",\"nodeName\":\"function_erm_auditflow（审批流程维护_页签）\",\"parentID\":\"9\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_auditflow\",\"resourceName\":\"审批流程维护_页签\",\"rsID\":108,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/commonBaseTypeAction.do?method=searchCommonBaseTypeForClient\",\"childResources\":[],\"fullPath\":\"9-109\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"109\",\"nodeName\":\"function_erm_baseprofile_menu_xueke（学科维护_页签）\",\"parentID\":\"9\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_baseprofile_menu_xueke\",\"resourceName\":\"学科维护_页签\",\"rsID\":109,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"fullPath\":\"9\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"nodeID\":\"9\",\"nodeName\":\"MOD_ERM_PARAM（参数设置）\",\"parentID\":\"\",\"protectedFunc\":false,\"resourceID\":\"MOD_ERM_PARAM\",\"resourceName\":\"参数设置\",\"rsID\":9,\"type\":\"pkg\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"childResources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/resource/index.erm\",\"childResources\":[],\"fullPath\":\"6-104\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"104\",\"nodeName\":\"function_erm_resource（系统集成_页签）\",\"parentID\":\"6\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_resource\",\"resourceName\":\"系统集成_页签\",\"rsID\":104,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"fullPath\":\"6\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"nodeID\":\"6\",\"nodeName\":\"MOD_ERM_RESOURCE（系统集成）\",\"parentID\":\"\",\"protectedFunc\":false,\"resourceID\":\"MOD_ERM_RESOURCE\",\"resourceName\":\"系统集成\",\"rsID\":6,\"type\":\"pkg\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"childResources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/role/index.erm\",\"childResources\":[],\"fullPath\":\"4-102\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"102\",\"nodeName\":\"function_erm_role（角色管理_页签）\",\"parentID\":\"4\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_role\",\"resourceName\":\"角色管理_页签\",\"rsID\":102,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"fullPath\":\"4\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"nodeID\":\"4\",\"nodeName\":\"MOD_ERM_ROLE（角色管理）\",\"parentID\":\"\",\"protectedFunc\":false,\"resourceID\":\"MOD_ERM_ROLE\",\"resourceName\":\"角色管理\",\"rsID\":4,\"type\":\"pkg\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"@type\":\"com.norteksoft.erm.model.Resource\",\"childResources\":[{\"@type\":\"com.norteksoft.erm.model.Resource\",\"actionPath\":\"/user/index.erm\",\"childResources\":[],\"fullPath\":\"5-103\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"isOpen\":\"true\",\"nodeID\":\"103\",\"nodeName\":\"function_erm_user（用户管理_页签）\",\"parentID\":\"5\",\"parentResource\":{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17]\"},\"protectedFunc\":true,\"resourceID\":\"function_erm_user\",\"resourceName\":\"用户管理_页签\",\"rsID\":103,\"type\":\"func\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}}],\"fullPath\":\"5\",\"grantedDelegates\":[],\"grantedPermissions\":[],\"nodeID\":\"5\",\"nodeName\":\"MOD_ERM_USER（用户管理）\",\"parentID\":\"\",\"protectedFunc\":false,\"resourceID\":\"MOD_ERM_USER\",\"resourceName\":\"用户管理\",\"rsID\":5,\"type\":\"pkg\",\"version\":0,\"webModule\":{\"$ref\":\"$.groups[1].users[1].webModules[0]\"}},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[2]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[0]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[2]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[0]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[0]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[0]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[2]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[0]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[0]\"},{\"$ref\":\"$.groups[1].users[1].webModules[0].resources[17].childResources[0]\"}],\"state\":\"0\",\"users\":[{\"$ref\":\"$.groups[1].users[1]\"}],\"version\":2,\"webModuleID\":1,\"webModuleName\":\"系统管理\"}]}],\"version\":1}],\"jobLevel\":{\"$ref\":\"$.groups[1].users[1].jobLevel\"},\"mainGroupID\":1,\"myFiles\":[],\"myMainGroup\":{\"$ref\":\"$.groups[1]\"},\"myPartTimeGroups\":Set[{\"$ref\":\"$.groups[1]\"}],\"password\":\"c612da2dba8fc89a6577324e21f71676\",\"realName\":\"asd\",\"rights\":[],\"roles\":[{\"@type\":\"com.norteksoft.erm.model.Role\",\"canAssignToUser\":true,\"childRoles\":[],\"code\":\"AA\",\"removeabled\":true,\"rights\":[],\"roleCategory\":{\"@type\":\"com.norteksoft.erm.model.RoleCategory\",\"code\":\"A\",\"myRoles\":[{\"$ref\":\"$.roles[0]\"}],\"name\":\"A\",\"oID\":30021,\"version\":0},\"roleID\":30022,\"roleName\":\"AA\",\"users\":[{\"$ref\":\"$\"}],\"version\":1}],\"state\":\"normal\",\"userID\":30189,\"userName\":\"asd\",\"username\":\"asd\",\"version\":2,\"webModules\":[]}";
	
	public static void main(String[] args) {
		 try {
			
			//test_ref();
			 int featureValues = DEFAULT_PARSER_FEATURE;
			  Feature[]features= new Feature[]{Feature.AllowISO8601DateFormat,Feature.IgnoreNotMatch};
		        for (Feature featrue : features) {
		            featureValues = Feature.config(featureValues, featrue, true);
		        }
			 ParserConfig parserConfig = new ParserConfig();
			    parserConfig.setAsmEnable(false);
			Object o=JSON.parseObject(json, com.norteksoft.erm.model.User.class,parserConfig,featureValues, features); //toBean( json);
			System.out.println(o);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public static Object newO(){
		com.norteksoft.erm.model.User u = new com.norteksoft.erm.model.User();
		u.setUserName("admin");
		return u;
	}
	public static String toJson(Object o){
		
		SerializeConfig serializeConfig = new SerializeConfig();
		serializeConfig.setAsmEnable(false);
			//String text = JSON.toJSONString(userManager.getByUserName("admin"), serializeConfig, SerializerFeature.PrettyFormat);
			SerializeWriter writer = new SerializeWriter();
			JSONSerializer serializer = new JSONSerializer(writer,serializeConfig);
			PropertyFilter filter = new PropertyFilter() {
			    public boolean apply(Object source, String name, Object value) {
			    	if(source.getClass().toString().matches(".*org.hibernate.*")||name.matches("(beanName)|(className)|(hibernateLazyInitializer)"))return false;
			    	//System.err.println(source.getClass()+"-name: "+name+" value: "+value);
			        return true;
			    }
			};
			serializer.getPropertyFilters().add(filter);
			serializer.config( SerializerFeature.PrettyFormat, false);
			serializer.config( SerializerFeature.WriteClassName, true);
			//serializer.config( SerializerFeature.QuoteFieldNames , false);
			serializer.write(writer);
			
		return writer.toString();
		
	}
	public static Object toBean(String json){
		
		ParserConfig parserConfig = new ParserConfig();
	    parserConfig.setAsmEnable(false);
	//	Object object=JSON.parseObject(json, User.class, new Feature[]{Feature.AllowISO8601DateFormat,Feature.IgnoreNotMatch});
		  int featureValues = DEFAULT_PARSER_FEATURE;
		  Feature[]features= new Feature[]{Feature.AllowISO8601DateFormat,Feature.IgnoreNotMatch};
	        for (Feature featrue : features) {
	            featureValues = Feature.config(featureValues, featrue, true);
	        }

	      //  DefaultJSONParser parser = new DefaultJSONParser(json, length, ParserConfig.getGlobalInstance(), featureValues);
	        DefaultJSONParser parser = new DefaultJSONParser(json, parserConfig, featureValues);
	        Object object =  parser.parseObject(com.norteksoft.erm.model.User.class);
	        parser.close();
		return object;
	}
	
	
	
	
	
	   public static int DEFAULT_PARSER_FEATURE;
	    static {
	        int features = 0;
	        features |= Feature.AutoCloseSource.getMask();
	        features |= Feature.InternFieldNames.getMask();
	        features |= Feature.UseBigDecimal.getMask();
	        features |= Feature.AllowUnQuotedFieldNames.getMask();
	        features |= Feature.AllowSingleQuotes.getMask();
	        features |= Feature.AllowArbitraryCommas.getMask();
	        features |= Feature.SortFeidFastMatch.getMask();
	        features |= Feature.IgnoreNotMatch.getMask();
	        DEFAULT_PARSER_FEATURE = features;
	    }
	    
	
	
	public static void test_ref() throws Exception {
		Group admin = new Group("admin");
		
		User jobs = new User("jobs");
		User sager = new User("sager");
		User sdh5724 = new User("sdh5724");
		
		admin.getMembers().add(jobs);
		jobs.getGroups().add(admin);
		
		admin.getMembers().add(sager);
		sager.getGroups().add(admin);
		
		admin.getMembers().add(sdh5724);
		sdh5724.getGroups().add(admin);
		
		sager.setReportTo(sdh5724);
		jobs.setReportTo(sdh5724);
		
		SerializeConfig serializeConfig = new SerializeConfig();
	//	serializeConfig.setAsmEnable(false);
		String text = JSON.toJSONString(admin, serializeConfig, SerializerFeature.PrettyFormat);
		System.out.println(text);
		

		ParserConfig config = new ParserConfig();
	    config.setAsmEnable(false);
	     
	    Object object=JSON.parseObject(text, Group.class, config, 0);
		System.out.println(object.getClass());
		}
}
